package com.ling.springbootinit.common;

import lombok.Data;

import java.io.Serializable;

/**
 * Weather 通用返回类
 */
@Data
public class WeatherResponse<T> implements Serializable {

    private T data;

    private int status;

    private String desc;

    public WeatherResponse(T data, int status, String desc) {
        this.status = status;
        this.data = data;
        this.desc = desc;
    }

    public WeatherResponse(T data, int status ) {
        this(data, status, "");
    }

    public WeatherResponse(ErrorCode errorCode) {
        this(null, errorCode.getCode(), errorCode.getMessage());
    }
}
